package com.kgc.stu.stuuserservice.service;

import com.kgc.stu.bean.Studentinfo;
import com.kgc.stu.service.StudentinfoService;
import com.kgc.stu.stuuserservice.mapper.StudentinfoMapper;
import org.apache.dubbo.config.annotation.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author shkstart
 * @create 2020-10-02 7:59
 */
@Service
public class StudentinfoServiceImpl implements StudentinfoService {

    @Resource
    StudentinfoMapper studentinfoMapper;

    @Override
    public List<Studentinfo> selectStudentinfo() {
        List<Studentinfo> studentinfos = studentinfoMapper.selectByExample(null);
        return studentinfos;
    }

    @Override
    public Integer addStudentinfo(Studentinfo studentinfo) {
        return studentinfoMapper.insert(studentinfo);
    }

    @Override
    public Studentinfo selectByid(Integer sid) {
        return studentinfoMapper.selectByPrimaryKey(sid);
    }

    @Override
    public Integer updateStudentinfo(Studentinfo studentinfo) {
        return studentinfoMapper.updateByPrimaryKeySelective(studentinfo);
    }
}
